﻿/* FlowPlayer Server Control for ASP.NET 2.0
* Copyright (C) 2008 Gaiaware AS
* All rights reserved. */

if (!Gaia.Extensions)
    Gaia.Extensions = Class.create();

Gaia.Extensions.SwfPlayer = Class.create();

/* inherit from Gaia Control*/
Object.extend(Gaia.Extensions.SwfPlayer.prototype, Gaia.Control.prototype);

/* implementation */
Object.extend(Gaia.Extensions.SwfPlayer.prototype, {

    // "Constructor"
    initialize: function(element, options) {
        this.initializeSwfPlayer(element, options);
    },

    initializeSwfPlayer: function(element, options) {
        this.initializeControl(element, options);
        
        var so = new SWFObject(options.fileName, "csSWF", options.width, options.height, "9.0.28", options.backgroundColor);
        so.addParam("quality", "best");
        so.addParam("allowFullScreen", options.allowFullScreen);
        so.addParam("scale", "showall");
        so.addParam("allowScriptAccess", "always");
        so.addVariable("autostart", options.autoStart);
        so.write(element);	        
    },

    destroy: function() {

        // call base destroy
        this._destroyImpl();
    }

});

Gaia.Extensions.SwfPlayer.browserFinishedLoading = true;